package com.example.listener;

import com.example.entity.Person;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.ItemWriteListener;

import java.util.List;

/**
 * @description
 * @author: ruanchengzhi
 * @create: 2021-07-30 13:46
 **/
public class BatchWriterListener implements ItemWriteListener<Person> {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Override
    public void beforeWrite(List<? extends Person> list) {
        logger.info("[op:batchWriterListener] beforeWrite [{}]", list.toString());
    }

    @Override
    public void afterWrite(List<? extends Person> list) {

    }

    @Override
    public void onWriteError(Exception e, List<? extends Person> list) {

    }
}
